import {Router} from "express";
import dictRouters from "@src/routes/front/dictRouters";
import literatureRouters from "@src/routes/front/literatureRouters";
import articleRouters from "@src/routes/front/articleRouters";
import regionRouters from "@src/routes/back/regionRouters";
import frontRegionRouters from "@src/routes/front/regionRouters";


// 前台接口
const frontRouter = Router();

// 字典接口
const dictRouter = Router();

frontRouter.use("/", dictRouter);
// 文献字典列表
dictRouter.get(
  dictRouters.paths.dictLiteratureList,
  dictRouters.dictLiteratureList,
);

// 文章字典列表
dictRouter.get(
  dictRouters.paths.dictArticleList,
  dictRouters.dictArticleList,
);

// 区域字典列表
dictRouter.get(
  dictRouters.paths.dictRegionList,
  dictRouters.dictRegionList,
);

// 文献列表接口
const literatureRouter = Router();
frontRouter.use("/", literatureRouter);
literatureRouter.get(
  literatureRouters.paths.list,
  literatureRouters.list,
);

literatureRouter.get(
  literatureRouters.paths.recommend,
  literatureRouters.recommend,
);

// 文献详情
literatureRouter.get(
  literatureRouters.paths.detail,
  literatureRouters.detail,
);

const articleRouter = Router();
frontRouter.use("/", articleRouter);
// 文章列表
articleRouter.get(
  articleRouters.paths.list,
  articleRouters.list,
);

// 文章详情
articleRouter.get(
  articleRouters.paths.detail,
  articleRouters.detail,
);

// 文章推荐
articleRouter.get(
  articleRouters.paths.recommend,
  articleRouters.recommend
)

const regionRouter = Router();
frontRouter.use("/", regionRouter);
// 区域详情
regionRouter.get(
  regionRouters.paths.detail,
  frontRegionRouters.detail,
);
// 区域关联列表
regionRouter.get(
  regionRouters.paths.relationArticleList,
  regionRouters.relationArticleList,
);

regionRouter.get(
  regionRouters.paths.relationLiteratureList,
  regionRouters.relationLiteratureList,
);

export default frontRouter;